import {
  nextPage
} from '../../assets/js/index'
import { mapState, mapMutations } from 'vuex'
export const mixinParams = {
  data () {
    return {
      appFlag: false,
      appObjFlag: false,
      envFlag: false
    }
  },
  computed: {
    ...mapState([
      'bugAppId',
      'bugAppObj',
      'expEnv',
      'path'
    ])
  },
  watch: {
    bugAppId: {
      handler: function (val) {
        this.appFlag = true
      },
      deep: true
    },
    bugAppObj: {
      handler: function (val) {
        this.appObjFlag = true
      },
      deep: true
    },
    expEnv: {
      handler: function (val) {
        this.envFlag = true
        nextPage('/home/bugIndex', '')
        this.pd_updatePath('/home/bugIndex')
      },
      deep: true
    }
  },
  methods: {
    ...mapMutations([
      'pd_updateBugAppId',
      'pd_updateBugApp',
      'pd_updateExpEnv',
      'pd_updatePath'
    ])
  }
}
